package main

import (
	"github.com/gin-gonic/gin"
	gp "github.com/mcuadros/go-gin-prometheus"
	"net/http"
)

func main() {
	//初始化gin引擎
	router := gin.Default()

	//生成prometheus探测指标
	prometheus := gp.NewPrometheus("gin")

	prometheus.Use(router)

	//生成一个路由
	router.GET("/", func(context *gin.Context) {
		context.JSON(http.StatusOK, gin.H{
			"code":    200,
			"message": "这里是狗蛋与美酱的快乐大本营",
		})
	})

	router.Run(":9000")
}
